<template>
  <h1>EL_消息提示组件</h1>
  <el-button @click="f(1)" type="success">buttonCont</el-button>
  <el-button @click="f(2)" type="danger">buttonCont</el-button>
  <el-button @click="f(3)" type="warning">buttonCont</el-button>
  <el-button @click="f(4)" type="info">buttonCont</el-button>
  <el-button @click="f(5)" type="primary">buttonCont</el-button>
</template>


<script setup>
import {ElMessage} from "element-plus";

const f = (type) => {
  switch (type){
    case 1: ElMessage.success('成功');break;
    case 2: ElMessage.error('失败');break;
    case 3: ElMessage.warning('警告');break;
    case 4: ElMessage('信息');break;
    case 5: ElMessage.success({
      message:"可以关闭",
      showClose:true
    });
  }
}
</script>


<style scoped>

</style>